var glob = require('glob');
var path = require('path');
var fs = require('fs');
var utils = require('./utils.js');

//获取所有入口文件
var routes={};
var entries = utils.getEntry('./pages/',false,'routes'); 
entries.forEach(function(val,index){
	var valus=require(val);
	for(var key in valus){
		routes[key]=valus[key];
	}
})
// 合并路由
module.exports = function (app) {
	for(var key in routes){
		app.use(key, routes[key]);
	}
};



